package com.xuanyuanxinyu.utils.log

import android.util.Log
import com.xuanyuanxinyu.utils.LogUtils

/**
 * @FileName:
 * @Description:
 * @author ken.luo
 * @date 2023/4/4
 * @version V1.0
 * @email 424533553@qq.com
 */
object AppLog {
    /**
     * 记录View 事件日志
     */
    const val PRINT_LOG = true
    const val GROUP_VIEW = "LOG_VIEW"
    const val GROUP_RETROFIT = "GROUP_RETROFIT"
    const val GROUP_NETWORK = "GROUP_NETWORK"
    const val GROUP_EVENT = "GROUP_EVENT"

    /* START **********************************************/
    /**
     * 状态监听
     */
    const val GROUP_STATE_LISTENER = "GROUP_STATE_LISTENER"
    
    /**
     * 设备状态
     */
    const val GROUP_DEVICE_STATUS = "GROUP_DEVICE_STATUS"
    
    /**
     * 连接状态监听
     */
    const val GROUP_CONNECT_LISTENER = "GROUP_CONNECT_LISTENER"
    
    const val GROUP_CAMERA_CMD = "GROUP_CAMERA_CMD"
    
    const val GROUP_CAMERA_TEST = "GROUP_CAMERA_TEST"
    
    /**
     * 设备AP 或STA模式连接日志
     */
    const val GROUP_CONNECT_DEVICE_MODE= "GROUP_CONNECT_DEVICE_MODE"
    
    /**
     * 网络状态监听
     */
    const val GROUP_CONNECT_NET_LISTENER = "GROUP_CONNECT_NET_LISTENER"
    const val GROUP_DEVICE_STATE_ERROR = "DEVICE_STATE_ERROR"
    const val GROUP_DEVICE_LOOPER_MESSAGE = "GROUP_DEVICE_LOOPER_MESSAGE"
    const val GROUP_DEVICE_PRESET_POSITION = "GROUP_DEVICE_PRESET_POSITION"
    
    /* END **********************************************/
    val loopMessageOpen = true
    

    
    const val TAG = "remotail"
    fun d(clazz : Class<*>,group : String,msg : String) {
        Log.d(TAG,"线程:" + Thread.currentThread().name + "|$group| ${clazz.simpleName} |$msg")
    }
    
    
    fun looper(clazz : Class<*>,group : String,msg : String) {
        if (loopMessageOpen) {
            Log.d(TAG,"线程:" + Thread.currentThread().name + "|$group| ${clazz.simpleName} |$msg")
        }
    }
    
    fun logE(clazz : Class<*>,group : String,msg : String) {
       LogUtils.logError("线程:" + Thread.currentThread().name + "|$group| ${clazz.simpleName} |$msg")
    }
    
    
    fun logDeviceError(clazz : Class<*>,group : String,msg : String) {
        LogUtils.logError("线程:" + Thread.currentThread().name + "|DEVICE_STATE_ERROR|$group| ${clazz.simpleName} |$msg")
    }
    
}